home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: Aug 28, 1998
- //
- // Author: bkwok
- //
- // Description:
- // This implements the "Texture" submenu on the modeling menubar.
- //
-
- global proc
- SubdRequestUVSetName (string $title, string $cmd, string $version, string $args[])
- //
- // Procedure Name:
- // SubdRequestUVSetName
- //
- // Description:
- // Helper method to ask the user for a new UV set name and then call
- // a command with the name as the final argument. The command will be
- // called like: $cmd $version $args "uvSetName"
- //
- // Input Arguments:
- // string $title The title for the dialog box
- // string $cmd The command to issue
- // string $version Version to pass onto the command
- // string $args Arguments to pass onto the command
- //
- // Return Value:
- // None.
- //
- {
- string $response = `promptDialog
- -title $title
- -message "UV Set Name:"
- -text "uvSet"
- -button "OK"
- -button "Cancel"
- -defaultButton "OK"
- -cancelButton "Cancel"
- -dismissString "Cancel"`;
- if ($response == "OK") {
- string $name = `promptDialog -query -text`;
- string $execute = ($cmd + " \"" + $version + "\" {");
- string $comma = "";
- for ($arg in $args) {
- $execute += ($comma + "\"" + $arg + "\"");
- $comma = ", ";
- }
- $execute += ("} \"" + $name + "\"");
- eval ($execute);
- }
- }
-
- global proc
- SubdTextureMenu (string $parent, int $creator, string $selectCmd)
- //
- // Procedure Name:
- // SubdTextureMenu
- //
- // Description:
- // Helper method to generate the menu items for the texture menus
- //
- // Input Arguments:
- // string $parent The name of the parent widget
- // int $creator Which creator is calling this
- // Current known creators
- // 0 Edit Polygons->Textures
- // 1 Relationship Editor->Edit->Create UV Set
- // string $selectCmd The command to issue to determine which objects
- // to affect
- //
- // Return Value:
- // None.
- //
- {
- setParent -m $parent;
-
- // string $prefix = ($creator == 0 ? "" : "SubdRequestUVSetName \"Create Planar Mapping\" ");
- string $prefix = ($creator == 0 ? "" : "SubdRequestUVSetName \"Create Planar Mapping\" ");
- string $cmd = $prefix + "performSubdProjectionArgList";
- string $version = "\"1\"";
- string $args0 = ("{\"0\", \"Planar\", \"" + $selectCmd + "\", \"" + ($creator == 1 ? "1" : "0") + "\"}");
- string $args1 = ("{\"1\", \"Planar\", \"" + $selectCmd + "\", \"" + ($creator == 1 ? "1" : "0") + "\"}");
- string $args2 = ("{\"2\", \"Planar\", \"" + $selectCmd + "\", \"" + ($creator == 1 ? "1" : "0") + "\"}");
- string $suffix = ($creator == 0 ? " \"\"" : "");
-
- string $dmc = "performSubdProjectionArgList \"1\" {\"2\", \"Planar\", \"ls -sl\", \"0\"} \"\";";
- string $c = ($cmd + " " + $version + " " + $args0 + $suffix);
- menuItem
- -label ($creator == 1 ? "Planar Mapping..." : "Planar Mapping")
- -ecr true
- -i "polyPlanProj.xpm"
- -dmc $dmc
- -ann "Planar Mapping: Create a projection planar to the selected faces"
- -c $c planarMappingItem;
- string $c = ($cmd + " " + $version + " " + $args1 + $suffix);
- menuItem -optionBox 1
- -i "polyPlanProj.xpm"
- -annotation "Planar Mapping Option Box"
- -l "Planar Mapping Option Box" -ecr false -c $c planarMappingOptionItem;
- /*
- string $prefix = ($creator == 0 ? "" : "SubdRequestUVSetName \"Create Cylindrical Mapping\" ");
- string $cmd = $prefix + "performPolyProjectionArgList";
- string $version = "\"1\"";
- string $args0 = ("{\"0\", \"Cylindrical\", \"" + $selectCmd + "\", \"" + ($creator == 1 ? "1" : "0") + "\"}");
- string $args1 = ("{\"1\", \"Cylindrical\", \"" + $selectCmd + "\", \"" + ($creator == 1 ? "1" : "0") + "\"}");
- string $args2 = ("{\"2\", \"Cylindrical\", \"" + $selectCmd + "\", \"" + ($creator == 1 ? "1" : "0") + "\"}");
- string $suffix = ($creator == 0 ? " \"\"" : "");
- string $dmc = "performPolyProjectionArgList \"1\" {\"2\", \"Cylindrical\", \"ls -sl\", \"0\"} \"\";";
- string $c = ($cmd + " " + $version + " " + $args0 + $suffix);
- menuItem
- -label ($creator == 1 ? "Cylindrical Mapping..." : "Cylindrical Mapping")
- -ecr true
- -i "polyCylProj.xpm"
- -dmc $dmc
- -ann "Cylindrical Mapping: Create a cylindrical projection on the selected faces"
- -c $c cylindricMappingItem;
- string $c = ($cmd + " " + $version + " " + $args1 + $suffix);
- menuItem -optionBox 1
- -i "polyCylProj.xpm"
- -annotation "Cylindrical Mapping Option Box"
- -l "Cylindrical Mapping Option Box" -ecr false -c $c cylindricMappingOptionItem;
-
- string $prefix = ($creator == 0 ? "" : "SubdRequestUVSetName \"Create Spherical Mapping\" ");
- string $cmd = $prefix + "performPolyProjectionArgList";
- string $version = "\"1\"";
- string $args0 = ("{\"0\", \"Spherical\", \"" + $selectCmd + "\", \"" + ($creator == 1 ? "1" : "0") + "\"}");
- string $args1 = ("{\"1\", \"Spherical\", \"" + $selectCmd + "\", \"" + ($creator == 1 ? "1" : "0") + "\"}");
- string $args2 = ("{\"2\", \"Spherical\", \"" + $selectCmd + "\", \"" + ($creator == 1 ? "1" : "0") + "\"}");
- string $suffix = ($creator == 0 ? " \"\"" : "");
- string $c = ($cmd + " " + $version + " " + $args0 + $suffix);
- string $dmc = "performPolyProjectionArgList \"1\" {\"2\", \"Spherical\", \"ls -sl\", \"0\"} \"\";";
- menuItem
- -label ($creator == 1 ? "Spherical Mapping..." : "Spherical Mapping")
- -ecr true
- -i "polySphereProj.xpm"
- -dmc $dmc
- -ann "Spherical Mapping: Create a spheric projection on the selected faces"
- -c $c sphericMappingItem;
- string $c = ($cmd + " " + $version + " " + $args1 + $suffix);
- menuItem -ob 1
- -i "polySphereProj.xpm"
- -annotation "Spherical Mapping Option Box"
- -l "Spherical Mapping Option Box" -ecr false -c $c sphericMappingOptionItem;
-
- //////////////////////////////////////////////////////////////////////
- menuItem -divider true;
-
- if ($creator != 1) {
- menuItem -l "Map UV Border" -ecr true
- -i "polyMapUVBorder.xpm"
- -ann "Map UV Border: Map the texture border indicated by selected UV to specified shape"
- -ddc "performPolyUntangleUV map 1"
- -dmc "performPolyUntangleUV map 2"
- -c "MapUVBorder" mapUVBorderItem;
- menuItem -optionBox 1 -i "polyMapUVBorder.xpm"
- -annotation "Map UV Border Option Box"
- -l "Map UV Border Option Box" -ecr false
- -c "performPolyUntangleUV map 1" mapUVBorderOptionItem;
-
- menuItem -l "Relax UVs " -ecr true
- -i "polyRelaxUVShell.xpm"
- -ann "Relax UVs: Relax the selected UVs"
- -ddc "performPolyUntangleUV relax 1"
- -dmc "performPolyUntangleUV relax 2"
- -c "RelaxUVShell" relaxUVShellItem;
- menuItem -optionBox 1 -i "polyRelaxUVShell.xpm"
- -annotation "Relax UVs Option Box"
- -l "Relax UVs Option Box" -ecr false
- -c "performPolyUntangleUV relax 1" relaxUVShellOptionItem;
-
- }
- */
-
- menuItem -l "Automatic Mapping"
- -ann "Automatic Projection: Select faces to be mapped automatically"
- -c "performSubdAutoProj 0" -i "polyAutoProj.xpm" ;
- menuItem -optionBox 1
- -l "Automatic Projection Option Box"
- -ann "Automatic Projection Option Box"
- -c "performSubdAutoProj 1" -ecr false -i "polyAutoProj.xpm";
-
- //////////////////////////////////////////////////////////////////////
- if ($creator != 1) {
- // menuItem -divider true;
-
-
- menuItem -l "Layout UVs"
- -ann "Layout UVs: Select faces to be moved in UV space"
- -c "performSubdLayoutUV 0" -i "polyLayoutUV.xpm";
- menuItem -optionBox 1
- -l "Layout UVs Option Box" -ann "Layout UVs Option Box"
- -c "performSubdLayoutUV 1" -ecr false -i "polyLayoutUV.xpm";
- }
- }
-